package com.hualan.web;

import com.hualan.service.ZixunyuyueService;
import com.hualan.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/zixunyuyue")
public class ZixunyuyueController {
    @Autowired
    private ZixunyuyueService zixunyuyueService;

    @RequestMapping("/addzixun")
    public ResultEntity addzixun(Integer uid,Integer tid, String level, String selected, String time, String text){
        return ResultEntity.ok(zixunyuyueService.addzixun(uid,tid, level, selected, time, text));
    }

    @RequestMapping("/shaixuan")
    public ResultEntity listAll(String level, String selected){
        return ResultEntity.ok(zixunyuyueService.listAll(level, selected));
    }

    @RequestMapping("/addshouye")
    public ResultEntity addshouye(Integer uid,Integer tid, String level, String selected, String time, String text){
        System.out.println("uid:"+uid);
        System.out.println("tid:"+tid);
        System.out.println("level:"+level);
        System.out.println("selected:"+selected);
        System.out.println("time:"+time);
        System.out.println("text:"+text);
        return ResultEntity.ok(zixunyuyueService.addshouye(uid,tid, level, selected, time, text));
    }

}
